package com.gxa.mapper;

import com.gxa.domain.entity.PayProject;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PayProjectMapper {
    PayProject queryById(int payProjectId);
    // 查询所有数据
    @Select("SELECT * FROM PayProject")
    List<PayProject> queryAll();

    // 分页查询数据
    @Select("SELECT * FROM PayProject LIMIT #{page}, #{size}")
    List<PayProject> queryPage(int page, int size);

    // 根据主键更新数据
    @Update("UPDATE PayProject SET column_name = #{columnName} WHERE id = #{id}")
    void updateById(@Param("id") Long id, @Param("columnName") String columnName);

    // 根据主键删除数据
    @Delete("DELETE FROM PayProject WHERE id = #{id}")
    void deleteById(@Param("id") Long id);

    // 根据完整记录新增数据
    @Insert("INSERT INTO PayProject(column_name) VALUES(#{columnName})")
    void add(@Param("columnName") PayProject columnName);
}
